package com.dhu719.label_end.service;

import com.dhu719.label_end.mapper.LabelMapper;
import com.dhu719.label_end.domain.Label;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>Title: $file.className</p>
 * <p>Description: </p>
 *
 * @author Kaboon
 * @date
 */
@Service
public class LabelService {
    @Autowired
    private LabelMapper labelMapper;

    public String addLabel(Label label) {
        try {
            labelMapper.AddLabel(label);
            return "success";
        } catch (Exception e) {
            System.out.println(e);
            return "failed";
        }
    }

    public Label selectByImageId(String image_id,String username) {
        return labelMapper.selectByImageId(image_id,username);
    }

    public String update(Label label){
        try {
            labelMapper.update(label);
            return "success";
        } catch (Exception e) {
            System.out.println(e);
            return "failed";
        }
    }
}
